package org.imis.action;

import java.util.List;
import java.util.Map;

import org.imis.domain.News;
import org.imis.service.NewsManage;

import com.opensymphony.xwork2.ActionContext;

public class ShouYeAction {
	private NewsManage newsManage;
	   private String table;
	   private String id;
	private Map request; 

	public String getTable() {
		return table;
	}

	public void setTable(String table) {
		this.table = table;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}
	public NewsManage getNewsManage() {
		return newsManage;
	}

	public void setNewsManage(NewsManage<?> newsManage) {
		this.newsManage = newsManage;
	}
	
	public String execute() throws ClassNotFoundException
	{
		
		request = (Map)ActionContext.getContext().get("request");  
		List list1 = newsManage.findNewsByPage("from News", 1, 6, 6);
		
		request.put("newslist", list1);
		
		List list2 = newsManage.findNewsByPage("from Notice", 1, 6, 6);
		request.put("noticelist", list2);
		
		List list3 = newsManage.findNewsByPage("from Forum", 1, 6, 6);
		request.put("forumlist", list3);
		
		List list4 = newsManage.findNewsByPage("from Information", 1, 6, 6);
		request.put("informationlist", list4);
		
		return "success";
		
	}

}
